home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Games Collection 1
/
software vault.zip
/
software vault
/
CDR10
/
YICN23.ZIP
/
SOURCE
/
TESTPRG.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1993-03-06
|
4KB
|
118 lines
#include <stdlib.h>
#include <string.h>
#include <conio.h>
#include <alloc.h>
#include "xlib.h"
#include "xrletool.h"
#include "icon.h"
#include "animicon.h"
#include "yakFont.h"
#include "yakStick.h"
#include "yakMouse.h"
#include "yakWin.h"
#include "yakPal.h"
#include "boodle.h"
#include "boodle2.h"
#include "boodle3.h"
#include "boodle4.h"
#include "yakscrol.h"
#include "yakpanel.h"
extern yakMouse mouse;
char * message = "testScroller: lo, indeed this is a test of the ill-begotten scroller class.";
void main(void)
{
yakLib myYakLib("draw");
yakScroller myYakScroller(0, 0, 50, 50, (char *)myYakLib.loadToMem("icon.h"));
yakFont myYakFont("6x8b.fnt");
icon background, myIcon, myOtherIcon;
icon::setZoomTable(64);
animicon myanimicon;
animslave myslave;
unsigned int backpage_offs;
x_set_mode(2,360);
x_set_doublebuffer(200);
x_text_init();
mouse.init();
yakPalette myYakPalette("standard.ypl");
myYakPalette.put();
myYakFont.use();
myYakScroller.activate(30,30);
yakWindow * myYakWindows[5];
for (int counter = 0; counter < 5; ++counter)
{
myYakWindows[counter] = new yakScroller(10 + random(50), 10 + random(50), 110 + random(75), 60 + random(75), (char *)myYakLib.loadToMem("icon.h"));
myYakWindows[counter]->myNumber = counter;
strcpy(myYakWindows[counter]->title, "Test Scroller ");
itoa(counter, &myYakWindows[counter]->title[14], 10);
x_bgprintf(0,150,VisiblePageOffs, 15, 0, "Core Left: %ld", farcoreleft());
myYakWindows[counter]->open();
}
while(yakWindow::topWindow != NULL)
yakWindow::advance();
yakPanel myYakPanel(20,20,120,100);
pSwitch mypSwitch(50,12,'T', "togg");
pSwitch myHoppingGrumjug(30,30,'G', "lgrumjug", icon::normal, &myYakLib, gadget::touchPad);
slider mySlider(10,50, 70,10, 0,40);
myYakPanel.add(new gadgetNode(new button(2,13,'Q',1,"button", icon::normal, &myYakLib),
new gadgetNode(new button(2,30,'M',2,"button", icon::normal, &myYakLib),
new gadgetNode(new label(2, 58,'V',3,"Label!", 15, 0),
new gadgetNode(&mypSwitch,
new gadgetNode(&myHoppingGrumjug,
new gadgetNode(&mySlider,NULL)))))));
/* myYakPanel.myButtonList.add(2,12, 'Q', 1, "button", icon::normal, &myYakLib);
myYakPanel.myButtonList.add(2,30, 'M', 2, "button", icon::normal, &myYakLib);
myYakPanel.myButtonList.add(new label(2,58, 'V', 3, "Label!", 15, 0));
myYakPanel.mypSwitchList.add(&mypSwitch);
myYakPanel.mypSwitchList.add(&myHoppingGrumjug);
myYakPanel.mySliderList.add(&mySlider);*/
myYakPanel.open();
while(yakWindow::topWindow != NULL)
{
word result = yakWindow::advance();
if (result)
x_bgprintf(0,175, VisiblePageOffs, 15, 0, "Button: %u", result);
}
while(!joystick1.readButton1() && !kbhit())
{
myYakPalette.rotate(yakPalette::up);
myYakPalette.put();
x_bgprintf(0,0,VisiblePageOffs, 15, 0, "Joystick 1: x:%d y:%d button1:%d button2: %d", joystick1.x, joystick1.y, joystick1.button1, joystick1.button2);
}
x_bgprintf(0,10,VisiblePageOffs, 15, 0, "Core Left: %ld", coreleft());
myIcon.load("star.yak", icon::normal, &myYakLib);
myOtherIcon.useData(boodleYak, icon::normal);
// myanimicon.addAll("boodle", icon::fast, &myYakLib);//, &myYakLib);
myanimicon.add(new animiconNode(boodleYak,
new animiconNode(boodle2Yak,
new animiconNode(boodle3Yak,
new animiconNode(boodle4Yak, (animiconNode *)NULL)))));
int x, y, exit = 0;
backpage_offs = NonVisual_Offs;// + (Page1_Offs - Page0_Offs);
int scale=200;
x = 50;
while ((exit != 'Q') && (scale > 4))
{
// x = random(320); y = random(200);
// myOtherIcon.show(0,100,VisiblePageOffs);
// while(!kbhit());
// exit = getch();
// if (exit == '<') scale--;
// if (exit == '>') scale++;
scale-=2;
x += 1;
myIcon.showZoomed(x, 20, VisiblePageOffs, scale);
x_bgprintf(0,150,VisiblePageOffs, 15, 0, "Scale: %d ", scale);
x_bgprintf(0,160,VisiblePageOffs, 15, 0, "Core Left: %ld ", farcoreleft());
}
for (counter = 0; counter < 25; ++counter)
{
myYakPalette.fade(-5);
myYakPalette.put();
}
mouse.remove();
x_text_mode();
}